package edu.friday.model;

import edu.friday.common.base.BaseModel;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.ColumnDefault;

import java.time.Instant;

@Getter
@Setter
@Entity
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "sys_menu", schema = "friday")
public class SysMenu extends BaseModel {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "menu_id", nullable = false)
    private Long id;

    @Size(max = 50)
    @NotNull
    @Column(name = "menu_name", nullable = false, length = 50)
    private String menuName;

    @ColumnDefault("0")
    @Column(name = "parent_id")
    private Long parentId;

    @ColumnDefault("0")
    @Column(name = "order_num")
    private Integer orderNum;

    @Size(max = 200)
    @ColumnDefault("''")
    @Column(name = "path", length = 200)
    private String path;

    @Size(max = 255)
    @Column(name = "component")
    private String component;

    @ColumnDefault("1")
    @Column(name = "is_frame")
    private Integer isFrame;

    @ColumnDefault("''")
    @Column(name = "menu_type")
    private Character menuType;

    @ColumnDefault("'0'")
    @Column(name = "visible")
    private Character visible;

    @Size(max = 100)
    @Column(name = "perms", length = 100)
    private String perms;

    @Size(max = 100)
    @ColumnDefault("'#'")
    @Column(name = "icon", length = 100)
    private String icon;

}